import request from '@/utils/request'

// 查询虾皮分类信息列表
export function listCategory(query) {
  return request({
    url: '/h2-shop-category/pageList',
    method: 'post',
    data:query
  })
}

// 查询虾皮分类信息详细
export function getCategory(catid) {
  return request({
    url: `/h2-shop-category/parent/${catid}`,
    method: 'get'
  })
}

// 新增虾皮分类信息
export function addCategory(data) {
  return request({
    url: '/h2-shop-category/save',
    method: 'post',
    data: data
  })
}

// 修改虾皮分类信息
export function updateCategory(data) {
  return request({
    url: '/h2-shop-category/save',
    method: 'post',
    data: data
  })
}

// 删除虾皮分类信息
export function delCategory(ids) {
  return request({
    url: `/h2-shop-category`,
    method: 'delete',
    data:ids
  })
}

//禁用启用分类信息
export function changeCategoryEnable(data) {
  return updateCategory({})
}

// switch修改
export function enable(id) {
  return request({
    url: `/h2-shop-category/enable/${id}`,
    method: 'get',
  })
}
